<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="node_modules/jquery/dist/jquery.js"></script>
</head>

<body>
    <img src="http://img5.duitang.com/uploads/item/201411/21/20141121174834_JLQ5W.thumb.700_0.jpeg" alt="">
</body>
<script>
    $(function() {

        var v = $(window).width();

        if (700 >= v && v > 500) {
            $("img").attr("src", "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3250324199,4243617895&fm=27&gp=0.jpg")
        }

        if (v <= 500) {
            $("img").attr("src", "http://c.hiphotos.baidu.com/image/pic/item/91529822720e0cf3457ad8150146f21fbf09aa4b.jpg")
        }

    })
</script>

</html>